package com.lanou.mapper;

import com.lanou.entity.ClassQaQuestion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClassQaQuestionMapper {
    int addClassQaQuestion(ClassQaQuestion classQaQuestion);
    /**
     * 查询问题列表（带回答和用户信息）
     * @param courseId 课程ID
     * @param orderRule 排序规则
     */
    List<ClassQaQuestion> selectQuestionsWithAnswers(
            @Param("courseId") Integer courseId,
            @Param("orderRule") String orderRule
    );

    //根据问题id获取问题详情
    public ClassQaQuestion getQuestionById(Integer id);
}
